﻿namespace Hidistro.UI.Common.Controls
{
    using ASPNET.WebControls;
    using System;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public class SourceOrderLable : Literal
    {
        private string GetOrderSource(int sourceorder)
        {
            switch (sourceorder)
            {
                case 2:
                    return ("<img src=\"" + Utils.ApplicationPath + "http://res.juseshop.com/utility/pics/tao.gif\" title=\"淘宝订单\"/>");

                case 3:
                    return ("<img src=\"" + Utils.ApplicationPath + "http://res.juseshop.com/utility/pics/wx.gif\"  title=\"微信订单\"/>");

                case 4:
                    return ("<img src=\"" + Utils.ApplicationPath + "http://res.juseshop.com/utility/pics/wap.gif\" title=\"手机订单\"/>");
            }
            return "";
        }

        protected override void Render(HtmlTextWriter writer)
        {
            base.Text = this.GetOrderSource((int) this.SourceOrder);
            base.Render(writer);
        }

        public object SourceOrder
        {
            get
            {
                return this.ViewState["SourceOrder"];
            }
            set
            {
                this.ViewState["SourceOrder"] = value;
            }
        }
    }
}

